-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
可用区内资源数量监控 #391
可用区内资源数量监控 #391
Conversation
47b025e
to
5a04f66
Compare
@@ -41,6 +49,10 @@ impl<T: ToNumber> MetricData for T { | |||
fn incr_to_cache(self, id: &Arc<Id>) { | |||
crate::register_cache(id, self.int()); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加个set方法更合适吧
} | ||
|
||
distance::host_region() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥返回string呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
与distance::host_region()保持一致;distance::host_region()返回string的原因是返回str会报错;
} else { | ||
0 // region功能关闭时,len_region为0,也就是不输出监控数据;可用区从打开到关闭场景,0也要生成监控数据,覆盖已有的同path旧数据 | ||
}; | ||
metrics::resource_num_metric( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加的指标数量会不会太多,内存总量有上升吗?指标动态创建会有瞬时的较大内存申请
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
从tcp copy环境看没有肉眼可见的增加
return region.clone(); | ||
} | ||
|
||
return "cnx".to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这也可以不用string吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
返回&str有编译报错
}; | ||
|
||
metric += n; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可用区指标相关不应放在host下吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没合适的位置;新增一个文件似乎也不值当。有建议的地方吗?
与#383的区别是:#383采用全局变量+lock,只推0;本方案是开启可用区,则可用区内的资源数量都推,按资源/端口维度推监控